package book.dao;

import book.model.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 处理数据 包括 增 删 查 改
 */
public class BookDao {

    public List<BookInfo> getBookList() {
        List<BookInfo> list = new ArrayList<>();
        for (int i = 1; i <= 10; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setBookName("书名" + i);
            bookInfo.setAuthor("作者" + i);
            bookInfo.setCount(i * 3);
            bookInfo.setPrice(new BigDecimal(i * 3 + 5));
            bookInfo.setPublish("出版社" + i);
            if (i % 3 == 0) {
                bookInfo.setStatus(1);
            } else {
                bookInfo.setStatus(2);
            }
            list.add(bookInfo);
        }
        return list;
    }

}
